package com.squirrel.michale.node;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/1/20 2:00 PM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class LeetCode0206 {

    public ListNode reverseList(ListNode head) {

        ListNode tempNode = null;
        ListNode result = null;

        while (head != null) {
            tempNode = head.next;
            head.next = result;
            result = head;
            head = tempNode;
        }
        return result;
    }
}
